@extends('default.layouts.companyPublic')

@section('title', '邀约面试记录')
@section('headcss')
    @parent
    <link rel="stylesheet" href="{{asset('/default/css/company/list.css')}}">
@endsection

@section('rightcon')
    <div class="right">
        <div class="jright">
            <div class="content">
                <div class="jobtitle">
                    <div class="tithead">
                        <ul>
                            <li class="active">邀约面试记录</li>
                        </ul>
                    </div>
                </div>
                {{--\搜索内容--}}
                <div class="jobsearch">
                    <form name="Formso" action="{{url('company/interview_manage')}}" method="get">
                        {!! csrf_field() !!}
                        <span><input name="keyWord" class="keyWord" value="" id="keyWord" placeholder="请输入职位名称或简历姓名" type="text"/></span>
                        <span><input class="searpos" value="" type="submit"/></span>
                    </form>
                </div>
                {{--显示列表--}}
                <div class="pinfo">
                    <form name="thisForm" action="{{url('company/interview_manage')}}" method="post">
                        {!! csrf_field() !!}
                        <div class="listmenu">
                            <ul class="one">
                                <li class="p1"></li>
                                <li class="p100">姓名</li>
                                <li class="p3">邀约岗位</li>
                                <li class="p2">基本信息</li>
                                <li class="p4">
                                    <div class="status">
                                        <input id="status" name="status" value="{{$status}}" type="hidden">
                                        <div id="status_select" class="select" style="width:126px; height:28px; line-height: 28px;">
                                            <span><a></a></span><i></i>
                                        </div>
                                    </div>
                                </li>
                                <li class="p5">邀请时间</li>
                                <li class="p90">撤销邀请</li>
                            </ul>
                            <div class="information"><span>共收到<em>{{$relist->total()}}</em>条面试记录！</span></div>
                            {{--循环--}}
                            @if($relist->count() > 0 )
                                @foreach($relist as $v)
                                    <ul id="list{{$v->id}}">
                                        <li class="p1">
                                            <input name="selected_id[]" class="checkboxs" value="{{$v->id}}" type="checkbox"/>
                                        </li>
                                        <li class="p100"><a class="linkbright" target="_blank" href="{{url('/resume_'.idEncryption($v->resume_id).'.html')}}">{{str_limit($v->name,9)}}</a></li>
                                        <li class="p3"><a target="_blank" href="{{url('/jobinfo_'.idEncryption($v->job_id).'.html')}}">{{str_limit($v->job_title,16)}}</a></li>
                                        <li class="p2">{{str_limit($v->cnsex.' | '.$v->birthday.'岁 | '.$v->education.' | '.$v->homeaddress,26)}}</li>
                                        <li class="p4">
                                            @if($v->status == '1')
                                                <span class="statusval">未回复</span>
                                            @elseif($v->status == '2')
                                                <span class="statusval normal">同意面试</span>
                                            @elseif($v->status == '3')
                                                <span class="statusval declined">已婉拒</span>
                                            @elseif($v->status == '0')
                                                <span class="statusval bright">未查收</span>
                                            @endif
                                        </li>
                                        <li class="p5">{{timeTranx($v->updated_at)}}</li>
                                        <li class="p90" id="operate"><a onclick="control('{{url('company/interview_destroy?id='.$v->id)}}','您真的要撤销邀请吗')"><i class="p revoked"></i></a></li>
                                    </ul>
                                @endforeach
                            @else
                                <div class="nullcon">对不起！没有符合条件的记录！</div>
                            @endif
                            <ul class="one last">
                                <li class="p1" style="width:80px;">
                                    <input name="selectall" id="selectall" class="checkboxs" value="1" type="checkbox" onclick="CheckAll(this)"/>
                                    <label for="selectall">全选</label>
                                </li>
                                <li class="p800">
                                    <span class="pborder" onclick="showconfirm('{{url('company/interview_tofavorite')}}','您真的要把选中的简历放入人才库吗')">放入人才库</span>
                                    <span class="pborder" onclick="showconfirm('{{url('company/interview_destroy')}}','您真的要把选中的简历撤销邀请吗')">撤销邀请</span>
                                </li>
                            </ul>
                        </div>
                    </form>
                </div>
                {{--分页--}}
                <div class="page_list">
                    {!! $relist->links() !!}
                </div>
            </div>
        </div>
    </div>

@endsection
@section('footerjs')
    @parent
    <script type="text/javascript" src="{{asset('/default/js/company/list.js')}}"></script>
    <script type="text/javascript">
        $("#leftnav_interview").addClass("active");
        var statusData = [
            {"value": '', "text": "状态不限"},
            {"value": 2, "text": "同意面试"},
            {"value": 3, "text": "已婉拒"}
        ];
        $("#status").select({
            optionData: statusData,
            callback: function (val, text) {
                window.location = "{{url('company/interview_manage')}}?status=" + val;
            }
        });
        @if(session('info'))
        layer.ready(function(){
            layer.msg("{{session('info')}}");
        });
        @endif
    </script>
@endsection
